package com.didispace.alibaba.sentinel.controller;

import com.didispace.alibaba.sentinel.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    private TestService testService;

    @Autowired
    public void setTestService(TestService testService) {
        this.testService = testService;
    }

    @GetMapping("/hello")
    public String hello() {
        return this.testService.sayHello();
    }

    @GetMapping("/hello/{name}")
    public String hello(@PathVariable String name) {
        return this.testService.sayHello(name);
    }
}
